﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataTreeLib;
using LiveSequence.Common.Domain;
using System.Windows.Forms;

namespace LiveSequence.Suite.Dialogs
{
  class FilterMethodCallTreeNodeMapper: ITreeNodeMapper
  {
    public FilterMethodCallTreeNodeMapper()
    {
    }

    #region ITreeNodeMapper Members

    public void UpdateNode(object dataNode, TreeNode treeNode)
    {
      DTreeNode<object> dn = (DTreeNode<object>)dataNode;
      treeNode.Tag = dn;

      MethodCallInfo methodCallInfo = dn.Value as MethodCallInfo;
      treeNode.Checked = methodCallInfo.Visible;
      string strText = string.Format("{0}::{1}", methodCallInfo.MethodCallType, methodCallInfo.MethodCallName);
      treeNode.Text = strText;
      //treeNode.ImageIndex = Convert.ToInt32(dn.Value.SelectionType); //treeNode.Level;
      //treeNode.SelectedImageIndex = Convert.ToInt32(dn.Value.SelectionType);
    }

    public object GetNodeInfo(TreeNode treeNode)
    {
      return treeNode.Tag;
    }
    #endregion

    #region ITreeNodeMapper Members


    public ContextMenuStrip GetContextMenuStrip(TreeNode treeNode)
    {
      return null;
    }

    #endregion
  }
}
